Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diplomatic adder example + basic mdoc infrastructure #2615

Merged
merged 13 commits into from
Sep 1, 2020

Conversation

debs-sifive
Copy link
Contributor

NOTE: The docs directory right now is set up to just contain the raw documentation src files. We may want to include the generated documents in the future, but doing this should also include some sort of check to make sure the generated docs are up-to-date with the source.

Related issue: N/A

Type of change: other enhancement (documentation)

Impact: no functional change

Development Phase: implementation

Release Notes

Add documentation directory and functionality to generate documents from markdown using embedded mdoc. Embedded mdoc code will compile against the codebase as part of CI checks.

`SourceNode`s have only outward pointing edges.

For our `AdderDriverNode`, `widths` of type `Seq[DownwardParam]` represents
the outputs of this node. We are using a `Seq` here because each node will send
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"the outputs of this node" => "the output wires of this node's module?"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like that could be misleading. Will try "the desired widths for the output wires of the module instantiating this node".

lazy val module = new LazyModuleImp(this) {
// generate random addends
val randomAddendA = FibonacciLFSR.maxPeriod(nodeA.out.head._2.width) // notice that we are using negotiated
val randomAddendB = FibonacciLFSR.maxPeriod(nodeB.out.head._2.width) // parameters here
Copy link
Member

@hcook hcook Aug 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a little off that you take head here but then foreach below. I mean, diplomacy should make that assumption a safe one for you, but I'd maybe recommend this instead:

def generateRandomAddend(width: Int) = FibonacciLFSR.maxPeriod(width)

nodeA.out.foreach { case (outputAddend, edgeParam) => outputAddend := generateRandomAddend(edgeParam.width) }
nodeB.out.foreach { case (outputAddend, edgeParam) => outputAddend := generateRandomAddend(edgeParam.width) }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in your code snippet, wouldn't that generate different addends per node? i.e. nodeA would pass two different random numbers into the adder/checker instead of the same random number.

That's why I called the LFSR once with the head width, not sure if you know of a better way to do it.


`dFn` maps **incoming downward** parameters into **outgoing downward** parameters.
Similarly, `uFn` maps **incoming upward** parameters into **outgoing upward** ones.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify what an "incoming" and an "outgoing" parameter is?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some clarification here: 4dbe86e

Hope that helps!

@debs-sifive debs-sifive requested a review from hcook August 27, 2020 22:56
@debs-sifive debs-sifive requested a review from hcook August 31, 2020 21:45
@debs-sifive debs-sifive merged commit 6f1f082 into master Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants